package com.fcl.oschina.ui.activity;

import android.content.Intent;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.fcl.mylibrary.reflect.OnClick;
import com.fcl.mylibrary.reflect.ViewInject;
import com.fcl.mylibrary.ui.layout.SceneLayout;
import com.fcl.mylibrary.util.FLog;
import com.fcl.mylibrary.util.StringUtil;
import com.fcl.oschina.Constant;
import com.fcl.oschina.R;
import com.fcl.oschina.adapter.CommentAdapter;
import com.fcl.oschina.adapter.RecommendAdapter;
import com.fcl.oschina.entity.AboutEntity;
import com.fcl.oschina.entity.CommentEntity;
import com.fcl.oschina.entity.DetailResult;
import com.fcl.oschina.model.CommentModel;
import com.fcl.oschina.model.DetailModel;

import java.util.ArrayList;
import java.util.List;

public class NewsDetailActivity extends DetailActivity {

    private String TAG = "NewsDetailActivity";

    @ViewInject(R.id.title)
    TextView mTitleTv;

    @ViewInject(R.id.author_date)
    TextView mAuthorDateTv;

    @ViewInject(R.id.software)
    TextView mSoftwareTv;

    @ViewInject(R.id.software_layout)
    LinearLayout mSoftwareLayout;



    private DetailResult.Software mSoftware;

    @Override
    public void setDetail(DetailResult detail) {
        super.setDetail(detail);
        mTitleTv.setText(detail.getTitle());
        mAuthorDateTv.setText(detail.getAuthor()+" 发布于 "+ StringUtil.formatSomeAgo(detail.getPubDate()));
        mSoftware = detail.getSoftware();
        if (mSoftware == null) {
            mSoftwareLayout.setVisibility(View.GONE);
        } else {
            mSoftwareTv.setText(mSoftware.getName());
        }
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_news_detail;
    }
}
